/*parent of*/
parent('Pam','Bob').
parent('Tom','Bob').
parent('Tom','Liz').
parent('Bob','Ann').
parent('Bob','Pat').
parent('Pat','Jim').
parent('Jim','Dim').

/*sex*/
woman('Pam').
woman('Liz').
woman('Pat').
woman('Ann').
man('Tom').
man('Bob').
man('Jim').
man('Dim').

/*child of*/
child(Y,X):- parent(X,Y).

/*mother of*/
mother(X,Y):- parent(X,Y), woman(X).

/*sister of*/
sister(X,Y):-parent(Z,X),parent(Z,Y),woman(X),X \== Y.

/*granfather of*/
granparent(X,Y):- parent(X,Z), parent(Z,Y).

/*granchild of       !no recurse*/
granchild(Y,X) :- parent(X,Z),parent(Z,Y).

/*same granfather*/

/*ancestor*/
ancestor(X,Y):- parent(X,Y).
ancestor(X,Y):- parent(X,Z),ancestor(Z,Y).



